//自动注册路由脚本
const fs = require('fs')
module.exports = (app) => {
    fs.readdirSync(__dirname).forEach(filename => {
        if (filename === 'index.js') { return }
        const route = require(`./${filename}`)
        app.use(route.routes()).use(route.allowedMethods());
    })
}